/*
 ============================================================================
 Name		: ResponseUserLayerScores.cpp
 Author	  : 
 Version	 : 1.0
 Copyright   :
 Description : CResponseUserLayerScores implementation
 ============================================================================
 */

#include "ResponseUserLayerScores.h"
#include "ResponseDefinses.h"
#include "ProjectsDefines.h"
#include "ResponseMagazineItemData.h"

CResponseUserLayerScores::CResponseUserLayerScores()
{
    // No implementation required
}

CResponseUserLayerScores::~CResponseUserLayerScores()
{

}

CResponseUserLayerScores* CResponseUserLayerScores::NewLC()
{
    CResponseUserLayerScores* self = new ( ELeave ) CResponseUserLayerScores( );
    CleanupStack::PushL( self );
    self->ConstructL( );
    return self;
}

CResponseUserLayerScores* CResponseUserLayerScores::NewL()
{
    CResponseUserLayerScores* self = CResponseUserLayerScores::NewLC( );
    CleanupStack::Pop( ); // self;
    return self;
}

void CResponseUserLayerScores::ConstructL()
{

}

void CResponseUserLayerScores::LoadValidResponseFromXmlNode(CElement* elementResponse)
{
    _ASSERT_LOG( elementResponse != NULL );

    if( !elementResponse )
    {
        return;
    }

    CElement* elementResult = elementResponse->GetElement( kResponseResultNode );

    _ASSERT_LOG( elementResult != NULL );
    if( !elementResult )
    {
        return;
    }
    _LIT( kResponseLayerScoreNode, "layer_score" );

    CElement* element = elementResult->GetElement( kResponseLayerScoreNode );
    if( element )
    {
        _layer_score = element->GetElementTextAsInt( );
    }
}
